// http://api.weatherapi.com/v1/current.json?key=96adb546290e446581353011201410&q=Melbourne
$(function () {
    let url = "http://api.weatherapi.com/v1/current.json"
    $.getJSON(
        url,
        {
            "key": "96adb546290e446581353011201410",
            "q": "Melbourne"
        },
        function (data) {
            var result = "Melbourne:" + data['current']['temp_c'] + "C " + data['current']['condition']['text'] + ".";
            if (data['current']['condition']['text'] === "Sunny") {
                result = result + "Enjoy Sunshine"
            }
            if (data['current']['condition']['text'] === "Cloudy") {
                result = result + "Be Happy"
            }
            $("#weather").text(result);
        }
    )
});
